package com.powernode.springmvc.controller;

import com.powernode.springmvc.bean.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
public class RequestBodyController {
    @RequestMapping(path = "/save", method = RequestMethod.POST)
    public String save(@RequestBody String requestBodyStr) {
        System.out.println("requestBodyStr:" + requestBodyStr);
        return "ok";
    }

    @RequestMapping(path = "/save2", method = RequestMethod.POST)
    public String save2(User user) {
        System.out.println("requestBodyStr:" + user);
        return "ok";
    }
}
